﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using NavigationSampleApp.Contexts;
using Smart.Navigation;
using Smart.Navigation.Context;

namespace NavigationSampleApp.Views
{
    /// <summary>
    /// 
    /// </summary>
    [View(ViewId.ContextConfirm)]
    public partial class ContextConfirmView : AppViewBase
    {
        [ViewContext]
        protected InputContext context;

        /// <summary>
        /// 
        /// </summary>
        public ContextConfirmView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public override void OnViewOpen(ViewForwardEventArgs args)
        {
            FormControl.SetTitle( "コンテキスト入力確認" );
            FormControl.SetButtonLeft( "前へ" );
            FormControl.SetButtonRight( "完了" );

            // 表示
            this.txtData1.Text = this.context.Data1;
            this.txtData2.Text = this.context.Data2;
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonLeft()
        {
            Navigator.Forward( ViewId.ContextInput2 );
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonRight()
        {
            Navigator.Forward( ViewId.Menu );
        }
    }
}
